package com.nervenets.web.hibernate.dao;

import com.nervenets.web.hibernate.domain.knowledge.Knowledge;
import com.nervenets.web.hibernate.domain.knowledge.KnowledgeFav;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

@Repository
public interface KnowledgeFavDao extends JpaRepository<KnowledgeFav, Long>, JpaSpecificationExecutor<KnowledgeFav> {
    KnowledgeFav findByUserIdAndKnowledge(long userId, Knowledge knowledge);

    Page<KnowledgeFav> findAllByUserId(long userId, Pageable pageable);
}
